import java.awt.*;
import javax.swing.*;
import java.io.File;
import java.io.IOException;
import java.util.Vector;

import jxl.Workbook;
import jxl.write.Label;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;

public class ImportLead {
	
	public ImportLead() throws RowsExceededException, WriteException, IOException {
		creatSheet();
		
	}
	public static void creatSheet() throws IOException, RowsExceededException, WriteException {
        //1:����excel�ļ�
        File file=new File("importData.xls");
        file.createNewFile();
        

        //2:����������
        WritableWorkbook workbook=Workbook.createWorkbook(file);
        //3:����sheet,���õڶ�����..��sheet���������Ƽ���
        WritableSheet sheet=workbook.createSheet("��������", 0);
        //4������titles
        String[] titles={"noteTitle","content","reminderTime(yyyy-MM-dd HH:mm:ss)", "ways(1.����,2.�ʼ�)", "mail"};
        //5:��Ԫ��
        Label label=null;
        //6:����һ����������
        for(int i=0;i<titles.length;i++){
            //x,y,��һ�е�����
            label=new Label(i,0,titles[i]);
            //7����ӵ�Ԫ��
            sheet.addCell(label);
        }
        //д�����ݣ�һ���ǵ�д�����ݣ���Ȼ�㶼��ʼ���������ˣ�excel����ɶ��û��
        workbook.write();
        //���һ�����رչ�����
        workbook.close();
        System.out.println("������ɣ�");
    }
		

	public static void main(String[] args) throws Exception {
		try {
			Runtime.getRuntime().exec("cmd  /c  start  E:\\project\\java\\test\\importData.xls");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		int res=JOptionPane
				.showConfirmDialog(null, "��ʼ���룿", "����", JOptionPane.YES_NO_OPTION);
			if(res==JOptionPane.YES_OPTION){ 
				//���붯��
				ImportRemind.main(null);
				//ˢ��ҳ��
				MainMenu myMenu = new MainMenu();
				myMenu.launch();

			}else{
				System.out.println("�޶���");    //������񡱺�ִ����������
				MainMenu myMenu = new MainMenu();
				myMenu.launch();

			return;
			}

	}
}
